package com.example.mvc.controller;

import com.example.mvc.model.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
public class PingController {

    @GetMapping("/ping")
    public String ping() {
        return "pong";
    }


    @GetMapping("/info")
    public UserInfo info() {
        return UserInfo.builder()
                .id(1001)
                .username("alice")
                .email("alice@gmail.com")
                .birth(LocalDate.now())
                .build();
    }
}
